// Pre Increment // Post Increment
#include <iostream>
using namespace std;

class Integer
{
    private:
        int x;
    public:
        void setData(int a)
        {
            x = a;
        }
        void getData()
        {
            cout << x << endl;
        }

        Integer operator++() //pre-increment
        {
            Integer temp;
            temp.x = ++x;
            return temp;
        }
        Integer operator++(int) //post-increment
        {
            Integer temp;
            temp.x = x++;
            return temp;
        }
};

int main() 
{
    Integer x1, x2;
    x1.setData(5);
    x2 = x1++;
    // x2 = ++x1;
    x1.getData();
    x2.getData();
}